package controller

import (
	"ginjt/login"
	"ginjt/topiccontroller"
	"github.com/gin-gonic/gin"
)

func TopicController(router *gin.Engine,group string) {
	v1 := router.Group(group)
	{
		v1.GET("/topic/:topic_id", topiccontroller.Topic)
		v1.Use(login.MustLogin)
		//router.Use(login.MustLogin)
		{
			v1.POST("/topic/:topic_id", topiccontroller.Topic)
		}


	}
	v11 := router.Group(group)
	v11.GET("/topics", topiccontroller.Topics)
	{
		v11.POST("/topic",topiccontroller.NewTopic)
	}
	//提交多条数据
	v11.POST("/mtopic",topiccontroller.MTopics)

}
